package moodish.server;

/**
 * This internal class handles the storage of the errors that occured in this
 * session.<br>
 * Do not tamper with error handling, as it may cause instability in the server.
 */
public class ErrorLog {

	/**
	 * The detail. Will mostly indicate the error stack trace
	 */
	public String detail;

	/** The method that invoked the error. */
	public String invoker;

	/**
	 * Instantiates a new error log.
	 * 
	 * @param detail
	 *            the details
	 * @param invoker
	 *            the invoker
	 */
	public ErrorLog(String detail, String invoker) {
		this.detail = detail;
		this.invoker = invoker;
	}

	/**
	 * Detail output.
	 * 
	 * @return a String with the output of this error
	 */
	public String detailOutput() {
		String output = "Logged Error detail: ";

		output = output + this.detail;
		output = output + " | Invoked by: ";
		output = output + this.invoker;

		return output;
	}

}